import Icon from "../_component/icon";

export default function Toolbar({
  title,
  subtitle,
  deleteEvent,
  popupDialog,
  refresh,
}) {
  return (
    <div className="card-body grow-0">
      <div className="flex justify-between gap-2">
        <h2 className="card-title grow">
          <div className="flex flex-col gap-1">
            <span className="card-title text-2xl">{title}</span>
            <span className="text-sm text-gray-400">{subtitle}</span>
          </div>
        </h2>
        <button className="btn btn-sm" onClick={() => refresh()}>
          <Icon name="refresh" color="none" />
        </button>
        <button className="btn btn-sm" onClick={() => popupDialog("add")}>
          <Icon name="add" color="none" />
        </button>

        <button className="btn btn-sm" onClick={deleteEvent}>
          <Icon name="delete" color="none" />
        </button>

        <button className="btn btn-sm" onClick={() => popupDialog("edit")}>
          <Icon name="edit" color="none" />
        </button>
      </div>
    </div>
  );
}
